<%--
  Created by IntelliJ IDEA.
  User: zk
  Date: 2017/11/8
  Time: 15:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<blockquote class="layui-elem-quote">${title}</blockquote>
<a href="${ctx}/sys/menu/form" class="layui-btn"><i class="layui-icon">&#xe608;</i>新增菜单</a>
<br>
<table class="layui-table"  id="treeTable" lay-filter="treeTable" lay-size="sm">
    <thead>
    <tr>
        <th>菜单名称</th>
        <th width="15%">节点值</th>
        <th width="9%">排序值</th>
        <th width="20%">菜单链接</th>
        <th width="10%">权限名</th>
        <th width="15%"><div class="layui-table-cell" align="center">操作</div></th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${list}" var="menu">
        <tr id="${menu.nodeId}" pId="${menu.parentId}">
            <td>${menu.name}</td>
            <td>${menu.nodeId}</td>
            <td>${menu.nodeValue}</td>
            <td>${menu.href}</td>
            <td>${menu.permission}</td>
            <td>
              <div class="layui-table-cell">
                <a class="layui-btn layui-btn-primary layui-btn-xs" href="${ctx}/sys/menu/form?parentId=${menu.nodeId}" data-pjax>新增子菜单</a>
                <a class="layui-btn layui-btn-xs layui-btn-normal" href="${ctx}/sys/menu/form?id=${menu.id}" data-pjax>编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" href="javascript:void(0);" onclick="delCustom('确定删除该菜单吗？','${ctx}/sys/menu/delete?id=${menu.id}')">删除</a>
                </div>
            </td>
        </tr>
    </c:forEach>
    </tbody>

</table>
<script>
    $(document).ready(function() {
        $("#treeTable").treeTable({expandLevel : 3}).show();
    });
    var layer = layui.layer;
    <c:if test="${message ne null and message ne ''}">
    layer.msg('${message}',{anim: 1});
    </c:if>
    <%--layui.use(['layer','table','element'], function(){--%>
            <%--layer = layui.layer;--%>
        <%--<c:if test="${message ne null and message ne ''}">--%>
        <%--layer.msg('${message}',{anim: 1});--%>
        <%--</c:if>--%>
    <%--});--%>
</script>
